<template>
  <el-card>
    <el-form
      :model="addCateForm"
      ref="addCateFormRef"
      :rules="addCateFormRules"
      label-width="100px"
    >
      <el-form-item label="分类名称" prop="cat_name">
        <el-input v-model="addCateForm.cat_name"></el-input>
      </el-form-item>
      <el-form-item label="父级分类"> </el-form-item>
    </el-form>
  </el-card>
</template>

<script setup lang="ts">
import { reactive } from 'vue'

const addCateForm = reactive({
  //将要添加的分类的名称
  cat_name: '',
  //父级分类的ID
  cat_pid: '',
  //当前分类等级，默认要添加的是1级分类
  cat_level: 0
})

//添加分类表单的验证规则对象
const addCateFormRules = reactive({
  cat_name: [{ required: true, message: '请选分类名称', trigger: 'blur' }]
})
</script>

<style scoped></style>
